cmake_minimum_required(VERSION 3.15)
project(HttsCpp)

set(CMAKE_CXX_STANDARD 14)

#INCLUDE_DIRECTORIES(src/main/resources/include)
#此处按需修改!!
INCLUDE_DIRECTORIES(E:/MinGw/x86_64-w64-mingw32/include)
#引入jni,$ENV{JAVA_HOME}是取系统环境变量的[JAVA_HOME]字段
INCLUDE_DIRECTORIES($ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/win32)
LINK_DIRECTORIES(src/main/resources/lib)

SET(TTSModule
        src/main/cpp/sapi/SAPIManager.cpp
        src/main/cpp/sapi/SAPITypeDef.cpp
        )
SET(TTSLib
        sapi.lib
        )

#生成dll
ADD_LIBRARY(HttsJna SHARED
        src/main/cpp/dllJna/HttsJna.cpp
        ${TTSModule}
        )
TARGET_LINK_LIBRARIES(HttsJna ${TTSLib})

#生成exe
ADD_EXECUTABLE(HttsJnaTest
        src/main/cpp/test/HttsJnaTest.cpp
        ${TTSModule}
        )
TARGET_LINK_LIBRARIES(HttsJnaTest ${TTSLib})

ADD_EXECUTABLE(CommonTest
        src/main/cpp/test/CommonTest.cpp
        )
TARGET_LINK_LIBRARIES(CommonTest ${TTSLib})